package org.lagou;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

//如果是war包发布，需要增加SpringBootServletInitializer字类，重写configure方法
//使用war包，springboot中规定的端口号不生效
@SpringBootApplication
public class DeployWarApp extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 注意这里要指向原先用main方法执行的Application启动类
        return builder.sources(DeployWarApp.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(DeployWarApp.class, args);
    }
}
